import { axios } from '@/utils/request'
import qs from 'qs'

const api = {
  modifyRequests: '/modify-requests'
}

export function getModifyRequests (params) {
  return axios({
    url: api.modifyRequests,
    method: 'get',
    params: params,
    paramsSerializer: p => qs.stringify(p, { arrayFormat: 'repeat' })
  })
}

export function getModifyRequestDetails (id) {
  return axios({
    url: `${api.modifyRequests}/${id}`,
    method: 'get'
  })
}

export function passModifyRequest (id) {
  return axios({
    url: `${api.modifyRequests}/${id}/pass`,
    method: 'POST'
  })
}

export function invalidModifyRequest (id) {
  return axios({
    url: `${api.modifyRequests}/${id}/invalid`,
    method: 'POST'
  })
}
